<%--
  Created by IntelliJ IDEA.
  User: Kohler
  Date: 2022/11/22
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>学生查看</title>
  <link rel="stylesheet" type="text/css" href="${path}css/common.css"/>
  <link rel="stylesheet" type="text/css" href="${path}css/main.css"/>
</head>
<body>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" +request.getServerName() + ":" + request.getServerPort() + path + "/";
    request.setAttribute("path",basePath);
%>
<%@include file="./adminSidebar.jsp"%>
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="adminManage.jsp">首页</a><span class="crumb-step"></span><span class="crumb-name">查看座位情况</span></div>
    </div>
    <div class="search-wrap">
        <div class="search-content">
            <form action="http://localhost:8080/Library/admin/studentSelectAll" method="get">
                <table class="search-tab">
                    <tr>
                        <th width="120">学院</th>
                        <td>
                            <input type="text" name="college"/>
                        </td>
                        <th width="120">性别</th>
                        <td>
                            <select name="square" >
                                <option value="男" selected>男</option>
                                <option value="女">女</option>
                            </select>
                        </td>
                        <td><input class="btn btn-primary btn2"  value="查询" type="submit"></td>

                    </tr>
                </table>
            </form>
        </div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="myform" method="post">
            <div class="result-title">
                <div class="result-list">
                    <a href="adminSeatAdd.jsp"><i class="icon-font"></i>添加座位</a>
                    <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                    <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>查看学生</a>
                </div>
            </div>
            <div class="result-content">
                <table class="result-tab" width="100%">
                    <tr>
                        <th class="tc" width="5%"><input class="allChoose" name="" onclick="selall(this)" type="checkbox"></th>

                        <th>学号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>电话</th>
                        <th>班级</th>
                        <th>专业</th>
                        <th>学院</th>
                        <th>操作</th>
                    </tr>
                    <c:forEach var="t" items="${studentlist}">
                    <tr>
                        <td class="tc"><input name="id[]" value="{t.sno}" type="checkbox"></td>
                        <td>${t.sno}</td>
                        <td>${t.sname}</td>
                        <td>${t.ssex}</td>
                        <td>${t.sphoneNumber}</td>
                        <td>${t.sclass}</td>
                        <td>${t.smajor}</td>
                        <td>${t.scollege}</td>
                        <td>
<%--                            <a class="link-update" href="http://localhost:8080/Library/admin/seatUpdate?tno=${s.tno}&cpage=${cpage}">修改</a>--%>
                            <a class="link-del" href="javascript:Delete('你确定删除【${t.sname}】吗?','http://localhost:8080/Library/admin/adminDeleteStudent?sno=${t.sno}')">删除</a>
                        </td>
                        </c:forEach>
                        <script>
                            function Delete(mess,url){
                                if(confirm(mess)){
                                    location.href=url;
                                }
                            }
                            function selall(o){
                                var a = document.getElementsByName('id[]');
                                for(var i=0;i<a.length;i++){
                                    a[i].checked = o.checked;
                                }
                            }
                        </script>
                </table>
                <div class="list-page">
                    共${tsum}条记录，当前${cpage}/${tpage}页
                    <a href="http://localhost:8080/Library/admin/studentSelectAll?cp=1${searchParams}">首页</a>
                    <a href="http://localhost:8080/Library/admin/studentSelectAll?cp=${cpage-1 < 0? 1:cpage-1}${searchParams}">上一页</a>
                    <a href="http://localhost:8080/Library/admin/studentSelectAll?cp=${cpage+1>tpage?tpage:cpage+1}${searchParams}">下一页</a>
                    <a href="http://localhost:8080/Library/admin/studentSelectAll?cp=${tpage}${searchParams}">尾页</a>
                </div>
            </div>
        </form>
    </div>
</div>
<!--/main-->
</div>


</body>
</html>
